package com.xdtech.trans.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.trans.model.TransWebSite;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-05-26 21:12:50
 * @since 1.0
 * @see
 */
public class TransWebSiteItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="名称")
	private String name;
	@GridColumn(title="简称")
	private String simpleName;
	@GridColumn(title="账户类型")
	private String accountType;
	@GridColumn(title="网点类型")
	private String websiteType;
	@GridColumn(title="网点级别")
	private String websiteLevel;
//	@GridColumn(title="上级网点")
	private String parentWebSite;
	
	private String parentId;
	@GridColumn(title="联系人")
	private String contacts;
	@GridColumn(title="手机")
	private String mobilePhone;
	@GridColumn(title="电话")
	private String telephone;
	@GridColumn(title="国家/省市")
	private String stateProvince;
	@GridColumn(title="地址")
	private String address;
	@GridColumn(title="邮编")
	private String postcode;
	@GridColumn(title="邮箱")
	private String email;
	@GridColumn(title="传真")
	private String fax;
	@GridColumn(title="QQ")
	private String qq;
	@GridColumn(title="备注")
	private String remark;

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
		addQuerys("name", name);
	}
	public String getName() {
		return name;
	}
	
	public void setSimpleName(String simpleName) {
		this.simpleName = simpleName;
		addQuerys("simpleName", simpleName);
	}
	public String getSimpleName() {
		return simpleName;
	}
	
	public void setAccountType(String accountType) {
		this.accountType = accountType;
		addQuerys("accountType", accountType);
	}
	public String getAccountType() {
		return accountType;
	}
	
	public void setWebsiteType(String websiteType) {
		this.websiteType = websiteType;
		addQuerys("websiteType", websiteType);
	}
	public String getWebsiteType() {
		return websiteType;
	}
	
	public void setWebsiteLevel(String websiteLevel) {
		this.websiteLevel = websiteLevel;
		addQuerys("websiteLevel", websiteLevel);
	}
	public String getWebsiteLevel() {
		return websiteLevel;
	}
	
	public void setParentWebSite(String parentWebSite) {
		this.parentWebSite = parentWebSite;
		addQuerys("parentWebSite", parentWebSite);
	}
	public String getParentWebSite() {
		return parentWebSite;
	}
	
	public void setContacts(String contacts) {
		this.contacts = contacts;
		addQuerys("contacts", contacts);
	}
	public String getContacts() {
		return contacts;
	}
	
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
		addQuerys("mobilePhone", mobilePhone);
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	
	public void setTelephone(String telephone) {
		this.telephone = telephone;
		addQuerys("telephone", telephone);
	}
	public String getTelephone() {
		return telephone;
	}
	
	public void setStateProvince(String stateProvince) {
		this.stateProvince = stateProvince;
		addQuerys("stateProvince", stateProvince);
	}
	public String getStateProvince() {
		return stateProvince;
	}
	
	public void setAddress(String address) {
		this.address = address;
		addQuerys("address", address);
	}
	public String getAddress() {
		return address;
	}
	
	public void setPostcode(String postcode) {
		this.postcode = postcode;
		addQuerys("postcode", postcode);
	}
	public String getPostcode() {
		return postcode;
	}
	
	public void setEmail(String email) {
		this.email = email;
		addQuerys("email", email);
	}
	public String getEmail() {
		return email;
	}
	
	public void setFax(String fax) {
		this.fax = fax;
		addQuerys("fax", fax);
	}
	public String getFax() {
		return fax;
	}
	
	public void setQq(String qq) {
		this.qq = qq;
		addQuerys("qq", qq);
	}
	public String getQq() {
		return qq;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
		addQuerys("remark", remark);
	}
	public String getRemark() {
		return remark;
	}
	
	public String getParentId()
	{
		return parentId;
	}
	public void setParentId(String parentId)
	{
		this.parentId = parentId;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TransWebSiteItem createItem(TransWebSite transWebSite) {
		TransWebSiteItem transWebSiteItem = new TransWebSiteItem();
		BeanUtils.copyProperties(transWebSiteItem, transWebSite);
		//自定义属性设置填充
		if (transWebSite.getParent()!=null) {
			transWebSiteItem.setParentId(transWebSite.getParent().getId()+"");
		}
		return transWebSiteItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TransWebSiteItem> createItems(List<TransWebSite> transWebSites) {
		List<TransWebSiteItem> transWebSiteItems = new ArrayList<TransWebSiteItem>();
		for (TransWebSite transWebSite : transWebSites) {
			transWebSiteItems.add(createItem(transWebSite));
		}
		return transWebSiteItems;
	}
}
